Skip to content

Template new entrant property merges - #128

Merged
EllieKallmier merged 6 commits into
mainfrom
template-new-entrant-property-merges
Jul 16, 2026
Merged

Template new entrant property merges#128
EllieKallmier merged 6 commits into
mainfrom
template-new-entrant-property-merges

Conversation

@EllieKallmier

@EllieKallmier EllieKallmier commented Jun 25, 2026

Copy link
Copy Markdown
Member

See below comment for updates - re: BOTN handling

This PR adds merging in of 'property' values for new entrant storage and generation tables. These are the numeric values that map to 'technology' (see the *_PROPERTY_MAP dicts in mappings for full coverage of what's getting merged in here). Still not outputting the *_new_entrant tables from templater so not 100% wired in yet - coming in next PR(s) :)

Storage gets split up into pumped hydro and battery chunks to merge in properties whose values are in different tables, then recombines to return a unified 'storage' table still. There's a bit of special handling around BOTN - Cethana, which is the only 'named' new entrant unit and has some bespoke mappings (using 'name' rather than 'technology' to key). Happy to take suggestions on this handling and have opened up #127 issue to explore this in a bit more depth.

Where things live

src/ispypsa/templater/
├── new_entrants.py ← the two orchestrators + the merge machinery + BOTN handling
├── mappings.py ← the property maps (common, battery, PHES)
├── create_template.py ← storage templater now takes the full iasr_tables dict
└── helpers.py ← incidental: _fuzzy_map_to_canonical renamed (see below)
src/ispypsa/iasr_table_caching/local_cache.py ← register battery_properties + pumped_hydro
tests/test_workbook_table_cache/7.5/*.csv ← frozen cache gains the property tables

There's also an incidental rename of _fuzzy_map_to_canonical -> _fuzzy_map_to_allowed_values because it became more useful to kind of flexibly specify which set of strings to use as the 'choices' than explicitly say one is canon.

LCF values to be merged in next :)

@EllieKallmier EllieKallmier added type: feature New feature or request module: templater Covers contents of `templater` module labels Jun 25, 2026
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/ispypsa/iasr_table_caching/local_cache.py 74.28% <ø> (ø)
...rc/ispypsa/templater/connection_and_build_costs.py 100.00% <100.00%> (ø)
src/ispypsa/templater/create_template.py 93.02% <100.00%> (ø)
src/ispypsa/templater/helpers.py 100.00% <100.00%> (ø)
src/ispypsa/templater/mappings.py 100.00% <100.00%> (ø)
src/ispypsa/templater/new_entrants.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@EllieKallmier
EllieKallmier removed the request for review from nick-gorman July 9, 2026 06:10
@EllieKallmier
EllieKallmier marked this pull request as draft July 9, 2026 06:12
@EllieKallmier

Copy link
Copy Markdown
Member Author

Made a change! I don't think this PR had been reviewed yet so to avoid making you review then basically re-review the same stuff I've just bundled an update to how I've handled BOTN - Cethana in here - hope that's not too much stuff in one block.

The main thing to note is just that for now I have jsut set BOTN's 'technology' to 'BOTN - Cethana'; most of the property tables key BOTN's values using that exact string (except for, annoyingly, pumped_hydro_new_entrant_properties which uses the long-form 'BOTN - Cethana - 20h'). So there is still one kinda niche declared rename for that table to allow the merges to just run smoothly.

There are some more notes and other thoughts from me in: #127. I don't think this is fully resolved/settled just yet so I'm going to keep that issue open, but will note that this is the approach I'll take for now (open to alternatives or preferences in a different direction ofc).

@nick-gorman nick-gorman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great Ellie. Very readable and nicely structured. I also agree with the testing mainly at the helper level here, as otherwise it would get quiet verbose.

Comment thread src/ispypsa/templater/mappings.py Outdated
Comment thread src/ispypsa/templater/new_entrants.py
Comment thread src/ispypsa/templater/new_entrants.py Outdated
@EllieKallmier
EllieKallmier merged commit 7ddd022 into main Jul 16, 2026
14 checks passed
@EllieKallmier
EllieKallmier deleted the template-new-entrant-property-merges branch July 16, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: templater Covers contents of `templater` module type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants